package sctu.edu.java.year2016.team04.luoxinghua.day20160605.chapter11_1;

/**编写一个异常类 在编写一个内部类该类有一个产生异常的方法speak（Int m）。当>1000时方法抛出异常类的对象
 *
 * Created by 落叶的思恋 on 2016/6/5.
 */
import java.util.Scanner;
    public class ExceptionWork11_1 extends Exception{
   class student extends Exception{
       int numpeple;
    int  personal(int numpeple) throws ExceptionWork11_1 {
      if (0>numpeple||numpeple>1000) {
          System.out.println(numpeple+">1000\n抛出异常");
              throw new ExceptionWork11_1();
      }
else System.out.println("一切正常numpeple="+numpeple);
      return numpeple;
   }
   }

    public static void main(String[] args) throws ExceptionWork11_1 {
      Scanner ss=new Scanner(System.in) ;
        int n=ss.nextInt();
        ExceptionWork11_1 exceptionWork11_1=new ExceptionWork11_1();
        ExceptionWork11_1.student Es=exceptionWork11_1.new student();
        Es.personal(n);



    }
}
